//
//  SXWYNewsThreeImageCell.m
//  ShiXun
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXWYNewsThreeImageCell.h"
#import "UIImageView+WebCache.h"
#import "SXWYNewsImageModel.h"
@implementation SXWYNewsThreeImageCell
- (void)setConfigureModel:(SXWYNewsMainModel *)configureModel
{
    _configureModel = configureModel;
    _replyLabel.text = configureModel.source;
    _titleLabel.text = configureModel.title;
    [_lCoverImg sd_setImageWithURL:[NSURL URLWithString:configureModel.imgsrc] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    [_mCoverImg sd_setImageWithURL:[NSURL URLWithString:((SXWYNewsImageModel *)configureModel.imageArray[0]).imgsrc] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    [_rCoverImg sd_setImageWithURL:[NSURL URLWithString:((SXWYNewsImageModel *)configureModel.imageArray[1]).imgsrc] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth - 50, 20)];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.font = [UIFont systemFontOfSize:15.5];
        [self.contentView addSubview:_titleLabel];
        
        _replyLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 150, 10, 140, 20)];
        _replyLabel.font = [UIFont systemFontOfSize:10];
        _replyLabel.textAlignment = NSTextAlignmentRight;
        _replyLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_replyLabel];
        
        _lCoverImg = [[UIImageView alloc] initWithFrame:CGRectMake(10, 40, (kScreenWidth - 30) / 3, (kScreenWidth - 30) / 4)];
        _mCoverImg = [[UIImageView alloc] initWithFrame:CGRectMake(15 + (kScreenWidth - 30) / 3, 40, (kScreenWidth - 30) / 3, (kScreenWidth - 30) / 4)];
        _rCoverImg = [[UIImageView alloc] initWithFrame:CGRectMake(20 + (kScreenWidth - 30) * 2 / 3, 40, (kScreenWidth - 30) / 3, (kScreenWidth - 30) / 4)];
        [self.contentView addSubview:_lCoverImg];
        [self.contentView addSubview:_mCoverImg];
        [self.contentView addSubview:_rCoverImg];
        
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
